# Actions

Actions enable you to make changes to the internal [AppState](/docs/api-reference/data-model/app-state) via the [dispatcher](/docs/api-reference/puck-api#dispatch).

This is a partial reference of the most useful actions. A full reference is available in [the codebase](https://github.com/measuredco/puck/blob/main/packages/core/reducer/actions.tsx).

## Types

### `setData`

Modify the [data payload](/docs/api-reference/data-model/data) currently managed by Puck.

| Param  | Example           | Type                                        | Status   |
| ------ | ----------------- | ------------------------------------------- | -------- |
| `type` | `type: "setData"` | "setData"                                   | Required |
| `data` | `data: {}`        | [Data](/docs/api-reference/data-model/data) | Required |

#### Example

```tsx
dispatch({
  type: "setData",
  data: {},
});
```

### `setUi`

Change a value on Puck's [UI state](/docs/api-reference/data-model/app-state#ui).

| Param  | Example                             | Type                                         | Status   |
| ------ | ----------------------------------- | -------------------------------------------- | -------- |
| `type` | `type: "setUi"`                     | "setUi"                                      | Required |
| `ui`   | `ui: { leftSideBarVisible: false }` | [UiState](/docs/api-reference/app-state/#ui) | Required |

#### Example

```tsx
dispatch({
  type: "setUi",
  ui: {
    leftSideBarVisible: false,
  },
});
```

### `set`

Change the entire [AppState](/docs/api-reference/data-model/app-state) in a single action.

| Param   | Example                       | Type                                                 | Status   |
| ------- | ----------------------------- | ---------------------------------------------------- | -------- |
| `type`  | `type: "set"`                 | "set"                                                | Required |
| `state` | `state: { data: {}, ui: {} }` | [AppState](/docs/api-reference/data-model/app-state) | Required |

#### Example

```tsx
dispatch({
  type: "set",
  state: { data: {}, ui: {} },
});
```
